// 两个链表 ，然后拼接
var partition = function(head, x) {
    let before = new ListNode(0)
    let after = new ListNode(0)
    let aindex = after
    let bindex = before
    while(head){
        let node = new ListNode(head.val)
        if(head.val > x || head.val == x){
            aindex.next = node
            aindex = aindex.next
        }else{
            bindex.next = node
            bindex = bindex.next
        }
        head = head.next
    }
    bindex.next = after.next
    return before.next
};